<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ include file="/common/taglibs.jsp" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>预警系统</title>
    <link href="${cdnctx}/dep/jquery/jquery-ui-1.10.2.custom.css" rel="stylesheet" type="text/css"/>
    <style>
        /*#container td {*/
        /*padding: 5px 10px;*/
        /*text-align: center;*/
        /*white-space: nowrap;*/
        /*}*/

        /*.ui-autocomplete-category {*/
        /*font-weight: bold;*/
        /*padding: .2em .4em;*/
        /*margin: .8em 0 .2em;*/
        /*line-height: 1.5;*/
        /*}*/

    </style>
    <%@ include file="/common/util.jsp" %>
    <script type="text/javascript">
        function jumpPage(pageNo) {
            window.location.href = "${cdnctx }/warning/allnightInit.shtml?" + $.param($("#allnightform").serializeObject()) + "&pageIndex=" + pageNo;
        }

        $.widget("brand.superAutocomplete", $.ui.autocomplete, {
            _renderMenu: function (ul, items) {
                var that = this;
                var parent = "";
                $.each(items, function (index, item) {
                    if (item.customer != parent) {
                        ul.append("<li class='ui-autocomplete-category'>" + item.customer + "</li>");
                        parent = item.customer;
                    }
                    that._renderItemData(ul, item)
                })
            }
        });

        $(function () {

            <%--var gateways = eval('${gateways}');--%>
            <%--$("#gatewayId").superAutocomplete({--%>
                <%--source: gateways,--%>
                <%--minLength: 0--%>
            <%--});--%>
            <%--$("#gatewayId").focus(function () {--%>
                <%--$(this).superAutocomplete('search');--%>
            <%--})--%>
        })
    </script>
</head>

<body class="main">
<div class="-frame -style -luster" id="css_container">

    <!--首页框架页眉部分↓-->
    <%@ include file="/WEB-INF/pages/inc/header.jsp" %>
    <!--首页框架页眉部分↑-->

    <div class="content">
        <!-- Left导航菜单◎开始 -->
        <%@ include file="/WEB-INF/pages/inc/leftmenu.jsp" %>
        <!-- Left导航菜单◎结束 -->
        <input type="hidden" class="form-control" id="sessionCustomerName" value="${customername }">

        <div class="main-mid">
            <div class="pos"><img src="${cdnctx}/src/index/img/index.png"><a href="">预警系统</a>
                ><a href="javascript:void(0);">空调通宵预警</a>
            </div>
            <div class="css_contentDiv">
                <div class="searchArea b-border-radius" style="padding:10px;">
                    <form class="form-inline" style="min-width:700px;"
                          id="allnightform"
                          action="/warning/allnightInit.shtml">
                        <label class="search_text">公司名称：</label>
                        <input type="text" class="search_input" id="customername" name="customername" value="${customername}" >
                        <label class="search_text">公司番号：</label>
                        <input type="text" class="search_input" id="companycode" name="companycode" value="${companycode}"  >
                        <%--<label class="search_text">网关号：</label>--%>
                        <%--<input type="text" style="cursor: pointer;" class="search_input" id="gatewayId"--%>
                               <%--name="gatewayId"--%>
                               <%--value="${gatewayId}" placeholder="选择网关">--%>
                        <label class="search_text">查询日期：</label>
                        <input type="text" style="cursor: pointer;" readOnly class="search_input Wdate" id="endDate"
                               name="endDate"
                               value="${endDate}" onfocus="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd'})"
                               placeholder="请输入查询日期">
                        <input type="submit" class="search_btn" id="searchEnergy" value="查询"/>
                    </form>
                </div>
                <div id="detailDiv" class="detailDiv">
                    <table id="sjxs" class="list_table">
                        <thead>
                        <tr>
                            <td>序号</td>
                            <td>公司番号</td>
                            <td>公司名称</td>
                            <td>网关</td>
                            <td>设备</td>
                            <td>通道</td>
                            <td>区域名称</td>
                            <td>开灯时间</td>
                            <td>操作</td>
                        </tr>
                        </thead>
                        <c:if test="${empty(allnight) }">
                            <tr class="even" style="color:red">
                                <td colspan="10" class="no-data" style="height: 280px;"></td>
                            </tr>
                        </c:if>
                        <c:if test="${not empty(allnight) }">
                            <tbody>
                            <c:forEach items="${allnight}" var="entity" varStatus="status">
                                <tr>
                                    <td>${status.index+1}</td>
                                    <td>${entity.companycode}</td>
                                    <td>${entity.customername}</td>
                                    <td>${entity.gatewayid}</td>
                                    <td>${entity.sensorid}</td>
                                    <td>${entity.channelid}</td>
                                    <td>${entity.areaname}</td>
                                    <td>${entity.activetime}</td>
                                    <td>
                                        <a href="${cdnctx}/economicBenefit/EconomicBenefitFth.shtml?&areaId=${entity.areaid}&gatewayid=${entity.gatewayid}&sensorid=${entity.sensorid}&channelid=${entity.channelid}&startTime=${endDate} 00:00:00&endTime=${endDate} 23:59:59">查看</a>
                                    </td>
                                </tr>
                            </c:forEach>
                            </tbody>
                        </c:if>
                    </table>
                    <br style="clear:both;">
                </div>
                <c:if test="${not empty(allnight) }">
                    <div id="pageInfo" class="pageJump">
                        <script type="text/javascript">
                            pagination.getPaginationHtml('JavaScript:jumpPage({0})', ${pageIndex}, ${pageCount}, 'pageInfo');
                        </script>
                        共有${dataCount}条数据
                    </div>
                </c:if>
            </div>
        </div>
        <!--首页框架页尾部分↓-->
        <%@ include file="/WEB-INF/pages/inc/footer.jsp" %>
        <!--首页框架页尾部分↑-->
    </div>
</body>
</html>